package main

import (
	"golang_learn/day5/example4/myStruct"
	"fmt"
)

func main() {
	var root *myStruct.Student = new(myStruct.Student)
	root.Name = "stu01"
	root.Age = 18
	root.Score = 100


	var left1 *myStruct.Student = new(myStruct.Student)
	left1.Name = "stu02"
	left1.Age = 18
	left1.Score = 100

	root.Left = left1

	var right1 *myStruct.Student = new(myStruct.Student)
	right1.Name = "stu03"
	right1.Age = 18
	right1.Score = 100

	root.Right = right1
	trans(root)
}

func trans(root *myStruct.Student) {
	if root == nil {
		return
	}
	fmt.Println(root)
	trans(root.Right)
	trans(root.Left)
}